<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:import href="base-template.imp.xsl" />
		
	<xsl:output encoding="UTF-8" method="html" saxon:character-representation="native" xmlns:saxon="http://saxon.sf.net/"/>
	
	<xsl:template name="content">
		<div class="title">Новости </div>
		<!--<center><img src="/images/pic-news.jpg" width="257"  height="130" alt="Audi"/></center> -->
		<xsl:if test="//page/logined/@status=2">
			<a href="/news/editor/" class="text">Добавить новость</a>
		</xsl:if>
		<xsl:for-each select="//page/News-list/News">
				<div class="date-news"><xsl:value-of select="@created" /></div>
				<a name="{@id}" id="{@id}" />
				<div class="title-article"><xsl:value-of select="@title" /></div>
				<div class="text"><xsl:value-of select="content" /></div>
				
				<xsl:if test="//page/logined/@status=2">
					<a href="/news/editor/{@id}" class="text">Редактировать</a> <![CDATA[&nbsp;&nbsp;]]>
					<a href="/news/editor/{@id}/remove" class="text">Удалить</a>
				</xsl:if>
				<br/><br/><br/>
		</xsl:for-each>
		

		
		<xsl:if test="//page/News-list/pages">
			<div class="text">
				Страницы:<![CDATA[&nbsp;&nbsp;]]>
				<xsl:for-each select="//page/News-list/pages/page">
				
					<xsl:choose>
						<xsl:when test="@selected">
							<xsl:value-of select="@num" />
						</xsl:when>
						<xsl:otherwise>
							<a href="/news/{@num}"><xsl:value-of select="@num" /></a>
						</xsl:otherwise>
					</xsl:choose>
					<![CDATA[&nbsp;&nbsp;]]>
				</xsl:for-each>
			</div>
		</xsl:if>
		
	</xsl:template>
	
</xsl:stylesheet>